import React from 'react';
import '../../static/setting/index.styl'
import {Tabs} from 'antd';
import HomeSetting from '../../containers/modules'
import Blacklist from '../../containers/setting/blacklist'
import Keyword from '../../containers/setting/keyword'
import Notice from './notice'
import SysWarn from './sysWarn'

const TabPane = Tabs.TabPane;

export default class Setting extends React.Component {
  state = {
    tabList: [{
      key: 1,
      name: '首页管理',
      component: <HomeSetting/>
    }, {
      key: 2,
      name: '关键词管理',
      component: <Keyword/>
    }, {
      key: 3,
      name: '系统预警',
      component: <SysWarn/>
    }, {
      key: 4,
      name: '黑名单',
      component: <Blacklist/>
    }, {
      key: 5,
      name: '公告管理',
      component: <Notice/>
    }]
  };
  changeHangle = (key) => {
  }

  componentDidMount() {
  }

  render() {
    return (
      <div className="setting">
        <Tabs defaultActiveKey="0" onChange={() => {
          this.changeHangle()
        }}>
          {
            this.state.tabList.map((item, i) => {
              return <TabPane tab={item.name} key={i}>{item.component}</TabPane>
            })
          }
        </Tabs>
      </div>
    );
  }
}